<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>登录</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.1.0/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/popper.js/1.12.5/umd/popper.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.1.0/js/bootstrap.min.js"></script>
</head>
<style>
    .container{
        margin-top:200px;
    }
    #login{
        margin: 0 auto;
    }
</style>
<body>
<div class="container">
    <div class="row" style="margin-top: 20px;">
        <div class="col-md-3" id="login">
            <h2 style="text-align: center">登陆</h2>
            <form th:action="@{/login}" method="post">
                <div class="form-group">
                    <label for="username">用户名</label>
                    <input type="text" class="form-control" id="userName" name="username" placeholder="Enter username">
                </div>
                <div class="form-group">
                    <label for="password">密码</label>
                    <input type="password" class="form-control" id="password" name="password" placeholder="Enter password">
                    <!--<span class="help-block" style="color:red" th:if="${param.error}">用户或密码错误，请重试</span>-->
                </div>
                <span class="help-block" style="color:red" th:if="${param.error}" th:text="${session.SPRING_SECURITY_LAST_EXCEPTION.message}"></span>
                <button type="submit" class="btn btn-primary" style="display:block;margin:0 auto">登录</button>
            </form>
        </div>
    </div>
</div>

</body>
</html>
